/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.kj.entity;

import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.entity.TreeEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * kjRegionEntity
 * @author hzy
 * @version 2021-08-08
 */
@Table(name="kj_region", alias="a", columns={
		@Column(name="city_code", attrName="cityCode", label="区域编码", isPK=true),
		@Column(includeEntity=TreeEntity.class),
		@Column(name="city_name", attrName="cityName", label="city_name", queryType=QueryType.LIKE, isTreeName=true),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.tree_sorts, a.city_code"
)
public class KjRegion extends TreeEntity<KjRegion> {
	
	private static final long serialVersionUID = 1L;
	private String cityCode;		// 区域编码
	private String cityName;		// city_name
	
	public KjRegion() {
		this(null);
	}

	public KjRegion(String id){
		super(id);
	}
	
	@Override
	public KjRegion getParent() {
		return parent;
	}

	@Override
	public void setParent(KjRegion parent) {
		this.parent = parent;
	}
	
	public String getCityCode() {
		return cityCode;
	}

	public void setCityCode(String cityCode) {
		this.cityCode = cityCode;
	}
	
	@Length(min=0, max=255, message="city_name长度不能超过 255 个字符")
	public String getCityName() {
		return cityName;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}
	
}